package com.example.two;

import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
//        Toast.makeText(this, "hello", Toast.LENGTH_LONG).show();
        AlertDialog dialog = new AlertDialog.Builder(this).setTitle("huanying")
                .setMessage("shifihbsda").setIcon(R.mipmap.ic_launcher).setPositiveButton("确定", null)
                .setNegativeButton("取消", null).create();
        dialog.show();
        Button btn = findViewById(R.id.btn);

        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                 Toast.makeText(this,"hello",Toast.LENGTH_LONG).show();
//                AlertDialog dialog = new AlertDialog.Builder(this).setTitle("huanying")
//                        .setMessage("shifihbsda").setIcon(R.mipmap.ic_launcher).setPositiveButton("确定", null)
//                        .setNegativeButton("取消", null).create();
//                dialog.show();
            }
        });
    }
}
